/*
 * mg1264-mware.h
 *
 *  Created on: 19 марта 2010
 *      Author: tipok
 */

#ifndef __MWARE_H
#define __MWARE_H

typedef enum
{
    AUD_FS_16000 = 16000,
    AUD_FS_24000 = 24000,
    AUD_FS_32000 = 32000,
    AUD_FS_44100 = 44100,
    AUD_FS_48000 = 48000
} AUD_FS;

typedef enum
{
    AUD_SAMPLE_SIZE_16 = 16,
    AUD_SAMPLE_SIZE_20 = 20,
    AUD_SAMPLE_SIZE_24 = 24
} AUD_SAMPLE_SIZE;

typedef enum
{
    AUD_MASTER_CLOCK_256FS,
    AUD_MASTER_CLOCK_512FS
} AUD_MASTER_CLOCK;

typedef enum
{
    AUD_BUS_CLOCK_32FS,
    AUD_BUS_CLOCK_64FS
} AUD_BUS_CLOCK;

typedef enum
{
    AUD_SERIAL_MODE_I2S,
    AUD_SERIAL_MODE_LEFT_JUSTIFIED,
    AUD_SERIAL_MODE_RIGHT_JUSTIFIED
} AUD_SERIAL_MODE;

typedef enum
{
    AUD_CHANNELS_STEREO,
    AUD_CHANNELS_STEREO_SWAP,
    AUD_CHANNELS_MONO_LEFT,
    AUD_CHANNELS_MONO_RIGHT
} AUD_CHANNELS;





typedef enum
{
    MWARE_FULL_DUPLEX,

    MWARE_MEM_POOL_START,
    MWARE_MEM_POOL_SIZE,

    MWARE_MUXER_VIDEO_BUFFER_SIZE,
    MWARE_MUXER_AUDIO_BUFFER_SIZE,
    MWARE_MUXER_DATA_BUFFER_INFO, // time << 8 | config index
    MWARE_MUXER_MAX_VIDEO_AU,
    MWARE_MUXER_MAX_AUDIO_AU,
    MWARE_INPUT_VIDEO_FRAMES,
    MWARE_INPUT_AUDIO_FRAMES,
    MWARE_ENCODE_VIDEO_FRAMES,
    MWARE_VENC_INSTRUCTION_BUFFER,

    MWARE_DEMUX_VIDEO_BUFFER_SIZE,
    MWARE_DEMUX_AUDIO_BUFFER_SIZE,
    MWARE_DEMUX_DATA_BUFFER_INFO, // time << 8 | config index
    MWARE_DEMUX_MAX_VIDEO_AU,
    MWARE_DEMUX_MAX_AUDIO_AU,
    MWARE_DECODE_VIDEO_FRAMES,
    MWARE_DECODE_AUDIO_FRAMES,

    MWARE_MAX_VIDEO_ENCODE_WIDTH,
    MWARE_MAX_VIDEO_ENCODE_HEIGHT,
    MWARE_MAX_VIDEO_DECODE_WIDTH,
    MWARE_MAX_VIDEO_DECODE_HEIGHT,
    MWARE_MAX_AUDIO_FRAME_SIZE,
    MWARE_MAX_AUDIO_AU_SIZE,

    MWARE_VIDEO_VPP_EXTERNAL_SYNC,
    MWARE_VIDEO_VPU_EXTERNAL_SYNC,
    MWARE_VIDEO_BIDIRECTIONAL_PORT,
    MWARE_VIDEO_PAL,
    MWARE_VIDEO_VPP_INPUT_WIDTH,
    MWARE_VIDEO_VPP_INPUT_HEIGHT,
    MWARE_VIDEO_VPP_PIXEL_AR_X,
    MWARE_VIDEO_VPP_PIXEL_AR_Y,
    MWARE_VIDEO_VPP_START_VLINE,
    MWARE_VIDEO_VPP_START_HPIXEL,
    MWARE_VIDEO_VPP_CHROMA_OFFSETYC,
    MWARE_VIDEO_VPP_FREE_RUN,
    MWARE_VIDEO_VPU_SYNC,
    MWARE_VIDEO_VPU_OUTPUT_WIDTH,
    MWARE_VIDEO_VPU_OUTPUT_HEIGHT,
    MWARE_VIDEO_VPU_PIXEL_AR_X,
    MWARE_VIDEO_VPU_PIXEL_AR_Y,
    MWARE_VIDEO_VPU_OUTPUT_OFFSET_X,
    MWARE_VIDEO_VPU_OUTPUT_OFFSET_Y,
    MWARE_VIDEO_VPP_PROGRESSIVE_IF,
    MWARE_VIDEO_VPP_PROGRESSIVE_SOURCE,
    MWARE_VIDEO_VPU_PROGRESSIVE_IF,
    MWARE_VIDEO_VPU_PHYSICAL_OFFSET_VERT,
    MWARE_VIDEO_VPU_PHYSICAL_OFFSET_HORZ,
    MWARE_VIDEO_VPU_VBLANK_LINES,
    MWARE_VIDEO_VPU_HBLANK_CLOCKS,
    MWARE_VIDEO_VPU_VACT_START,
    MWARE_VIDEO_VPU_PHYSICAL_OUTPUT_WIDTH,
    MWARE_VIDEO_VPU_PHYSICAL_OUTPUT_HEIGHT,

    MWARE_VIDEO_VPP_START_VLINE_2NDFIELD,
    MWARE_VIN_SENSOR_ID,
    MWARE_VOUT_LCD_T,
    MWARE_VOUT_LCD_DIR,

    MWARE_VIS_OSD_MAX_WIDTH,
    MWARE_VIS_OSD_MAX_HEIGHT,
    MWARE_VIS_OSD_BIT_DEPTH,

    MWARE_APP_OSD_SCREENS,
    MWARE_APP_OSD_MAX_WIDTH,
    MWARE_APP_OSD_MAX_HEIGHT,
    MWARE_APP_OSD_BIT_DEPTH,
    MWARE_APP_OSD_SCRN_WIDTH,
    MWARE_APP_OSD_SCRN_HEIGHT,

    MWARE_APP_RES_N_OSD_FRAMES,

    MWARE_AUDIO_AII_SERIALMODE,
    MWARE_AUDIO_AII_DRIVELRCK_SCKPHASE,
    MWARE_AUDIO_AII_SAMPLE_SCKPHASE,
    MWARE_AUDIO_AII_SAMPLESIZE,
    MWARE_AUDIO_AII_SCK_SLAVE,
    MWARE_AUDIO_AII_LRCK_SLAVE,
    MWARE_AUDIO_AII_MCLKTOFS_RATIO,
    MWARE_AUDIO_AII_SCKTOLRCK_RATIO,

    MWARE_AUDIO_AOI_SERIALMODE,
    MWARE_AUDIO_AOI_DRIVE_SCKPHASE,
    MWARE_AUDIO_AOI_SAMPLELRCK_SCKPHASE,
    MWARE_AUDIO_AOI_SAMPLESIZE,
    MWARE_AUDIO_AOI_MCLKTOFS_RATIO,
    MWARE_AUDIO_AOI_SCKTOLRCK_RATIO,

    MWARE_ENCODE_FIELD_PICTURES,
    MWARE_DISABLE_VIS_FRAMES,

    MWARE_NUM_PARAMS
} MWARE_PARAM;



#define MWARE_SIZE 88 /* x 4bytes */

int mware_defaults(crusher_t *crusher);
int mware_tune_config(crusher_t *crusher);


#endif //__MWARE_H


